#pragma once
#include <d3dx9.h>
#include "BBox.h"
#include "ObjAnimater.h"

class cModel;

class cObject
{
public:
	D3DXMATRIX			mOrigin;
	D3DXMATRIX			world;
	D3DXVECTOR3		mPosition;
	D3DXVECTOR3		mRotation;
	D3DXVECTOR3		mRotation_1;
	D3DXVECTOR3		mScale;
	D3DXVECTOR3		mTarget;

	cModel*					mModel;
	BBox							mBBox;
	BSphere					mBSphere;

	IObjAnimater*	mAnimator;

	int								life;
	int								type;
	int								damage;
	int								posnumber;
	int								createsize;
	char*							bullettype;
	char*							posType;
	bool								isLive;

public:
	cObject(void);
	~cObject(void);

	D3DXMATRIX getWorldTM();
	D3DXMATRIX getModelWorldTM();
	BBox getBoundingBox()						{ return mBBox ; }
	void setPosition(const D3DXVECTOR3& pos)	{ mPosition = pos; }
	void setRotate(const D3DXVECTOR3& rot)		{ mRotation = rot; }
	void setScale(const D3DXVECTOR3& scale)		{ mScale = scale; }
	void animate();
	//void render(IDirect3DDevice9 *pd3dDevice);
	void render( bool bDrawBBox,bool bFlag);
	void render( bool bDrawBBox );
};
